#  author:张靖昆 date:2020/3/13 name:0_工资解析 IDE:PyCharm
import re
jobs=[
    {"id":"1001","salary":"3-8千/月"},
    {"id":"1003","salary":"1-2.5万/月"},
    {"id":"1005","salary":"30-50万/年"},
    {"id":"1007","salary":"4.5-8.5千/月"},
]

salary='30-50万/年'
reg_salary=r'\d+(?:\.\d+)?'
result=re.findall(reg_salary,salary)

min_salary = float(result[0])
max_salary = float(result[1])

level=1

if '千/月' in salary:
    level=1000
elif "万/月" in salary:
    level=10000
elif "万/年" in salary:
    level=10000/12
min_salary=min_salary*level
max_salary=max_salary*level

# jobs['min_salary']=min_salary*level
# jobs['max_salary']=max_salary*level

print(min_salary)
print(max_salary)